package com.eshop.user.controller;

import com.eshop.base.protocol.Result;
import com.eshop.user.config.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/config")
public class ConfigController {
    private static final Logger log = LoggerFactory.getLogger(ConfigController.class);

    @Autowired
    private Config config;

    @Value(value = "${useLocalCache: 127.0.0.1}")
    private String useLocalCache;

    @RequestMapping("/")
    public Result<Config> get() {
        return Result.success(config);
    }
}
